import request from "@/request/request"
import qs from "qs"

// 净瓶推荐数据接口
// export const JingpinAPI = function (){
//     return request.get("/products/recommend");
// }
// 精品推荐数据接口
export const JingpinAPI = () => request.get("/products/recommend")

// 热门兑换/products/hot
export const RemenAPI = () => request.get("/products/hot")

// 发送验证码接口
export const SendMSAPI = (params) => request.post('/sendSMS',qs.stringify(params))

// 发送登录接口
export const PhoneLoginAPI = (params) => request.post('/phoneRegin',qs.stringify(params))

// 微信扫码登录接口
export const WeixinLoginAPI = (params) => request.post('/wechatUsers/PCLogin',qs.stringify(params))

// 手机绑定登录
export const BindPhoneAPI = (params) => request.post('/wechatUsers/binding',qs.stringify(params))


// 获取用户信息
export const UserProfilesAPI = () => request.get("/shop/userProfiles")
// 请求详情页接口
export const GoodDetailsAPI = (id) => request.get(`/products/${id}`);
// 加入购物车
export const AddToCartAPI = (params) => request.post('/shop/carts/add',qs.stringify(params))
// 请求全部商品接口 /products
export const GoodsSearchAPI = (params) => request.get('/products',{params})
// 请求购物车数据
export const CartDataAPI = () => request.get('/shop/carts');
// 请求删除商品
export const CartDelAPI = (params) => request.delete(`/shop/carts?productIds=${params.id}`);